<table class="index" id='payments' data-order-id='<%= @order.number %>'>
  <thead>
    <tr data-hook="refunds_header">
      <th><%= Spree::Refund.human_attribute_name(:created_at) %></th>
      <th><%= Spree::Payment.human_attribute_name(:number) %></th>
      <th><%= Spree::Refund.human_attribute_name(:amount) %></th>
      <th><%= Spree::PaymentMethod.model_name.human %></th>
      <th><%= Spree::Refund.human_attribute_name(:transaction_id) %></th>
      <th><%= Spree.t(:reason) %></th>
      <% if show_actions %>
        <th class="actions"></th>
      <% end %>
    </tr>
  </thead>
  <tbody>
    <% refunds.each do |refund| %>
      <tr id="<%= dom_id(refund) %>" data-hook="refunds_row" class="<%= cycle('odd', 'even', name: 'refund_table_cycle')%>">
        <td><%= pretty_time(refund.created_at) %></td>
        <td class="align-center"><%= refund.payment.identifier %></td>
        <td class="align-center amount"><%= refund.display_amount %></td>
        <td class="align-center"><%= payment_method_name(refund.payment) %></td>
        <td class="align-center"><%= refund.transaction_id %></td>
        <td class="align-center"><%= truncate(refund.reason.name, length: 100) %></td>
        <% if show_actions %>
          <td class="actions">
            <%= link_to_with_icon 'edit', Spree.t('actions.edit'), edit_admin_order_payment_refund_path(refund.payment.order, refund.payment, refund), no_text: true %>
          </td>
        <% end %>
      </tr>
    <% end %>
  </tbody>
</table>
